<?php

require_once '../../vendor/Cassandra-PHP-Client-Library/Cassandra.php';
require_once '../TuxDb.php';

class TuxDbCassandra implements TuxDb {
	
	private $servers = array(
				array(
						'host' => 'localhost',
						'port' => 9160,
						'use-framed-transport' => true,
						'send-timeout-ms' => 1000,
						'receive-timeout-ms' => 1000
				)
	);
	
	public function __construct() {
		
	}
	
	public function connect() {
		
		$cassandra = Cassandra::createInstance($servers);
		$cassandra->setMaxCallRetries(5);
		$cassandra->useKeyspace('MyAlcohoList');		
	}
	
	public function getInstance() {
		
		$cassandra = Cassandra::getInstance();
		return $cassandra;
	
	}
	
}